	#include "ConexionServer.h"

ConexionServer::ConexionServer()
{
	this->socket = new Socket();
}

ConexionServer::ConexionServer(Socket *socket){
	this->socket = socket;
}

ConexionServer::~ConexionServer()
{
	delete this->socket;
}

bool ConexionServer::listen(const unsigned int port, const unsigned int maxClientes){
	return (this->socket->create() &&
			this->socket->bind(port) &&
			this->socket->listen(maxClientes));

}

bool ConexionServer::shutdownAndClose(){
	bool shutdown;
	bool close;

	shutdown = this->socket->shutdown();
	close = this->socket->close();

	return (shutdown && close);
}

bool ConexionServer::getConectado(){
	return this->socket->getConectado();
}
